package com.zwz.controller.jwt;

import com.zwz.controller.util.Result;
import io.jsonwebtoken.SignatureException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;


/**
 * @author Alysia
 * @date 2022/11/7 10:20
 */
@RestControllerAdvice
public class PermissionHandler {
    @ExceptionHandler(value = {SignatureException.class})
    @ResponseBody
    public Result authorizationException(SignatureException e) {
        return Result.error(401, "无权访问," + e.getMessage());
    }
}